<?php
namespace Home\Controller;
use Think\Controller;
class RegisterController extends Controller {

	//注册验证
    public function index(){
    	$data = I('post.');
    	$user = D('user');

    	if(!$res = $user->create($data)){
    		$this->error($user->getError());
    	}else{	
    		$register = M('user');

    		if ($register->add($res)) {
				$this->success('注册成功',U('Home/Login/index'));    			
    		}else{
    			$this->error('注册失败');
    		}
    	}
    }


}